home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Freeware / DiskMaster / Rexx / Decrunch.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2002-10-27  |  533 b   |  24 lines

  1. /* $VER: Decrunch.rexx 1.0 (18.11.98) by J. Tierney
  2.  
  3.   Decrunch.rexx  v1.0
  4.   11/18/98  J. Tierney
  5.  
  6.   Purpose:  Decrunches files using XFDDecrunch, deleting the ".pp" or ".xpk"
  7.            suffix if necessary.
  8.  
  9.   Usage:  Decrunch.rexx <filename>
  10. */
  11.  
  12. PARSE ARG fname
  13. fname = STRIP(fname, 'B')
  14.  
  15. ADDRESS COMMAND 'C:C2/XFDDecrunch >NIL: CLONE' fname
  16.  
  17. x = LASTPOS('.', fname)
  18. IF x ~= 0 THEN DO
  19.   ext = SUBSTR(fname, x + 1)
  20.   IF (ext = 'pp') | (ext = 'xpk') THEN DO
  21.     ADDRESS COMMAND 'RENAME >NIL:' fname 'TO' LEFT(fname, x - 1)
  22.   END
  23. END
  24.